<template>
  <div>
    <div class="child1">
      子组件1
      <div class="child1_bottom" @click="changeBlue">切换颜色按钮</div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {}
  },
  inject: ['getBlue'],
  methods: {
    changeBlue() {
      this.getBlue()
    }
  }
}
</script>

<style lang="less" scoped>
.child1 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 200px;
  width: 150px;
  background-color: #dae8fc;
  border: 1px solid #7192c1;
  text-align: center;
  color: black;
  .child1_bottom {
    height: 50px;
    line-height: 50px;
    width: 120px;
    margin: 40px auto;
    text-align: center;
    background-color: #0150ef;
    color: #ffffff;
    border-radius: 10px;
    border: 1px solid black;
  }
}
</style>
